<template>
	<view class="pgae">
		<view v-for="item in evaList" :key="item.id" class="all">
			<view class="one">
				<view class="name">xxx</view>
				<view class="on">
					<view class="time">评价时间:{{ item.time }}</view>
					<view class="number" @click="nav(item)">{{ item.serviceOrder.id }}</view>
				</view>
			</view>

			<view class="two">
				<view class="score1">综合评分:</view>
				<view class="score2">{{ item.rate }}分</view>
				<uni-rate :readonly="true" :value="item.rate" style="margin-left: 13px; margin-top: -3px" />
			</view>
		</view>
	</view>
</template>

<script>

export default {
	data() {
		return {
			// List: [
			// 	{
			// 		id: 1,
			// 		name: '张三风',
			// 		time: '2022-10-10 11:09',
			// 		number: '2021010831213',
			// 		score: 3
			// 	},
			// 	{
			// 		id: 2,
			// 		name: '冯玉祥',
			// 		time: '2022-10-10 11:09',
			// 		number: '2021010831213',
			// 		score: 3
			// 	}
			// ],
			evaList: [],
			userList: ''
		};
	},
	onLoad() {
		// console.log(uni.getStorageSync('UserInfo'));
		// var da = uni.getStorageSync('UserInfo')
		// console.log(da)
	},
	created() {
		this.getEva();
		this.getUser();
	},
	methods: {
		// 计算属性，用于生成名字的掩码版本
		// maskedName(name) {
		// 	// 只显示第一个字符，其余部分用星号替代
		// 	const firstChar = name.slice(0, 1);
		// 	const stars = '*'.repeat(name.length - 1);
		// 	return firstChar + stars;
		// },

		nav(item) {
			uni.setStorageSync('id', item.id),
			uni.navigateTo({
				url: '/pages/evaluate/orderDetail/orderDetail?id=' + item.serviceOrder.id 
			});
		},
		getEva() {
			uni.request({
				url: 'http://localhost:9206/evaluate/list',
					
				method: 'GET', // 请求方法
				param:{
					id:this.evaList.id
				},
				success: (res) => {
					console.log('请求成功:', res);
					this.evaList = res.data.rows;
				},
				fail: (err) => {
					console.error('请求失败:111', err);
				}
			});
		},
		getUser() {
			uni.request({
				url: 'http://localhost:9207/identityVerification/list',
				method: 'GET', // 请求方法
				data: {}, // 请求体，传递的数据
				header: {
					// 'Authorization': `Bearer ${token}`
					// Authorization: `Bearer eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjA2NzkxYWFiLWFlYmMtNDQ2Yy1iOTNjLTM0YWJiNWExZDAxNSIsInVzZXJuYW1lIjoiYWRtaW4ifQ.rOzX8DtBXl9l3LIfvsFhvEieOAPi-ptVQNfiudg8oiKkv1rdZpV0wjOhIooHqVIq85yRvaXmVmksuSqiL0Ldfg`,
					// Cookie: 'Admin-Token=eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX2tleSI6IjA2NzkxYWFiLWFlYmMtNDQ2Yy1iOTNjLTM0YWJiNWExZDAxNSIsInVzZXJuYW1lIjoiYWRtaW4ifQ.rOzX8DtBXl9l3LIfvsFhvEieOAPi-ptVQNfiudg8oiKkv1rdZpV0wjOhIooHqVIq85yRvaXmVmksuSqiL0Ldfg; Admin-Expires-In=720; sidebarStatus=0'
				},
				success: (res) => {
					// console.log('请求成功:', res);
					this.userList = res.data.rows;
				},
				fail: (err) => {
					console.error('请求失败:111', err);
				}
			});
		}
	}
};
</script>

<style>
.pgae {
	left: 0px;
	top: 0px;
	width: 375px;
	height: 812px;
	background-color: rgba(255, 255, 255, 1);
}
.all {
	margin-left: 5px;
	width: 360px;
	height: 99px;
	line-height: 20px;
	border-radius: 4px 4px 4px 4px;
	background-color: rgba(255, 255, 255, 1);
	color: rgba(16, 16, 16, 1);
	font-size: 14px;
	text-align: center;
	font-family: Roboto;
	border: 1px solid rgba(206, 206, 206, 0.88);
}
.one {
	margin-top: 18px;
	display: flex;
}
.on {
	display: flex;
}
.name {
	margin-left: 13px;
	width: 32px;
	height: 23px;
	line-height: 23px;
	color: rgb(16, 16, 16);
	font-size: 16px;
	text-align: left;
	font-family: SourceHanSansSC-medium;
}
.time {
	margin-left: 15px;
	width: 167px;
	height: 21px;
	line-height: 20px;
	color: rgba(154, 154, 154, 1);
	font-size: 12px;
	text-align: left;
	font-family: PingFangSC-regular;
}
.number {
	margin-left: 13px;
	width: 109px;
	height: 21px;
	line-height: 20px;
	color: rgba(29, 111, 255, 1);
	font-size: 14px;
	text-align: left;
	font-family: SourceHanSansSC-medium;
	text-decoration: underline;
	cursor: pointer; /* 鼠标悬停时显示手型图标 */
}
.two {
	margin-top: 13px;
	display: flex;
}
.score1 {
	margin-left: 15px;
	width: 70px;
	height: 20px;
	line-height: 20px;
	color: rgba(16, 16, 16, 1);
	font-size: 14px;
	text-align: left;
	font-family: PingFangSC-regular;
}
.score2 {
	margin-left: -3px;
	width: 23px;
	height: 20px;
	line-height: 20px;
	color: rgba(108, 108, 108, 1);
	font-size: 14px;
	text-align: left;
	font-family: PingFangSC-regular;
}
</style>
